﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="tpView.aspx.cs" Inherits="tpView" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSourceTpzb">
    <ItemTemplate >  <asp:Label ID="LblTitle" runat="server" Text='<%# Eval("t_Name") %>' Font-Size="Larger"></asp:Label>
            <p class="date">
                <img src="images/more.gif" alt="" />
                <asp:Label ID="LblClassname" runat="server" Text='<%# Eval("c_Name") %>'></asp:Label>
                <img src="images/timeicon.gif" alt="" />
                <asp:Label ID="Label2" runat="server" Text='<%# Eval("t_settime") %>'></asp:Label></p>
            <p></ItemTemplate></asp:Repeater>
    <asp:SqlDataSource ID="SqlDataSourceTpzb" runat="server" 
        ConnectionString="<%$ ConnectionStrings:qynbControlSystemConnectionString %>" 
        
        SelectCommand="SELECT tpzb.tpID, tpzb.t_Name, tpzb.t_Cus, tpzb.t_settime, tpzb.starttime, tpzb.endTime, cusInfo.c_Name FROM tpzb INNER JOIN cusInfo ON cusInfo.cusID = tpzb.t_Cus WHERE (tpID = @tpID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="tpID" QueryStringField="tpID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" 
    DataSourceID="SqlDataSourcetpcb" DataTextField="cb_name" DataValueField="cbID" 
    Width="237px">
</asp:RadioButtonList>
<asp:SqlDataSource ID="SqlDataSourcetpcb" runat="server" 
    ConnectionString="<%$ ConnectionStrings:qynbControlSystemConnectionString %>" 
    SelectCommand="SELECT * FROM [tpcb] WHERE ([tpID] = @tpID)" 
        InsertCommand="INSERT INTO tpjl(cbID, tpID, j_cusID, J_time) VALUES (@Param1, @Param2, @Param3, @Param4)" 
        oninserting="SqlDataSourcetpcb_Inserting">
    <InsertParameters>
        <asp:Parameter Name="Param1" />
        <asp:Parameter Name="Param2" />
        <asp:Parameter Name="Param3" />
        <asp:Parameter Name="Param4" />
    </InsertParameters>
    <SelectParameters>
        <asp:QueryStringParameter Name="tpID" QueryStringField="tpID" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:Button ID="Button1" runat="server" Text="投票" onclick="Button1_Click" />
    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="查看投票情况" />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSourcetpcb" EnableModelValidation="True" Visible="False" 
        Width="428px">
        <Columns>
            <asp:BoundField DataField="cbID" HeaderText="cbID" SortExpression="cbID" />
            <asp:BoundField DataField="cb_name" HeaderText="cb_name" 
                SortExpression="cb_name" />
            <asp:BoundField DataField="cb_count" HeaderText="cb_count" 
                SortExpression="cb_count" />
        </Columns>
    </asp:GridView>
</asp:Content>

